<?php
/* @var $this CategoryController */
/* @var $model Category */
/* @var $form CActiveForm */
?>
<script type="text/javascript">
<!--
seajs.use(['manage'], function (manage) {
	$(function(){
		manage.product();
	});
})
//-->
</script>
<div class="form">

<?php

$form = $this->beginWidget ( 'CActiveForm', array (
		'id' => 'category-form',
		'enableAjaxValidation' => false 
) );
?>
	<div class="row">
		<?php echo $form->labelEx($model,'name'); ?>
		<?php echo $form->textField($model,'name',array('size'=>45,'maxlength'=>45)); ?>
		<?php echo $form->error($model,'name',array('class'=>'alert alert-error')); ?>
	</div>
	<div class="row">
		<div id="category_tree" class="ztree"></div>
	</div>
	<div class="row">
		<?php echo $form->labelEx($model,'parent'); ?>
		<?php echo $form->dropDownList($model,'parent',Category::model()->getCategories());?>
		<?php echo $form->error($model,'parent',array('class'=>'alert alert-error')); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? '创建' : '更新'); ?>
	</div>

<?php $this->endWidget(); ?>

</div>
<!-- form -->